package com.oocl.zero.task0710.property.store;

import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;

import com.oocl.zero.task0710.property.compare.BirthdayComparator;
import com.oocl.zero.task0710.property.compare.IdComparator;
import com.oocl.zero.task0710.property.entity.Customer;

public class CustomerStore {
	private static Set<Customer> set=new HashSet<Customer>();

	public static Set<Customer> getSet() {
		return set;
	}

	public static void setSet(Set<Customer> set) {
		CustomerStore.set = set;
	}

	public static Set<Customer> sortById(){
		Set<Customer> rs=new TreeSet<Customer>(new IdComparator());
		rs.addAll(set);
		return rs;
	}

	public Set<Customer> sortByBirthday() {
		Set<Customer> rs=new TreeSet<Customer>(new BirthdayComparator());
		rs.addAll(set);
		return rs;
	}
}
